package com.zzjson.design.observer.gperadvice;

import java.util.Observable;
import java.util.Observer;

/**
 * <p>****************************************************************************</p>
 * <p><b>Copyright © 2010-2019 shuncom team All Rights Reserved<b></p>
 * <ul style="margin:15px;">
 * <li>Description : com.zzjson.design.observer.gperadvice</li>
 * <li>Version     : 1.0.0</li>
 * <li>Creation    : 2019年04月03日</li>
 * <li>@author     : zzy0_0</li>
 * </ul>
 * <p>****************************************************************************</p>
 */
public class Teacher implements Observer {
    private String name;

    public Teacher(String name) {
        this.name = name;
    }

    @Override
    public void update(Observable o, Object arg) {
        GPer gper = (GPer) o;
        Question question = (Question) arg;
        System.out.println(name + "老师，你好!\n" +
                "您收到了一个来自“" + gper.getName() + "”的提问，希望您解答，问题内容如下:\n" + question.getContent() + "\n" + "提问者" + question.getUserName());
    }
}